package edu.mobbuzz.daf.facade;

import java.util.ArrayList;
import java.util.List;

import edu.mobbuzz.daf.bean.Logs;
import edu.mobbuzz.daf.dao.ILogsDao;

public class LogsFacade  extends BaseFacade{
private ILogsDao logsDao;
	
	public ILogsDao getLogsDao() {
		if(logsDao==null)
			logsDao = (ILogsDao)getFactory().getBean("logsDao");
		return logsDao;
	}
	
	
	
	public boolean addLogs(Logs logs){		
		try{
			getLogsDao().insert(logs);
			return true;
		}catch (Exception e) {
			return false;
		}
		
	}
	
	public boolean updateLogs(Logs logs){		
		try{
			getLogsDao().update(logs);
			return true;
		}catch (Exception e) {
			return false;
		}
		
	}
	
	public List<Logs> getLogsList(String where, String order){		
		List<Logs> logsList = getLogsDao().queryForList(where, order);
		
		if(logsList==null){
			logsList = new ArrayList<Logs>();
			return logsList;			
		}else{
			return logsList;
		}
	}
	
	public Logs getLogs(String where){		
		Logs _logs = (Logs)getLogsDao().queryForBaseBean(where);
		return _logs;
		
	}
	
}
